﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>dates</title>

    <!-- WinJSContrib.Core references -->
    <script src="./scripts/jquery-2.1.1.js"></script>
    <script src="./scripts/winjscontrib/jquery.mcnext.WinJS.js"></script>
    <script src="./scripts/winjscontrib/mcnext.ui.utils.js"></script>
    <script src="./scripts/winjscontrib/mcnext.ui.bindings.js"></script>

    <!-- WinJSContrib.Dates references -->
    <script src="./scripts/moment.min.js"></script>
    <script src="./scripts/winjscontrib/mcnext.date.utils.js"></script>

    <link href="dates.css" rel="stylesheet" />
    <script src="dates.js"></script>
</head>
<body>
    <div class="dates fragment">
        <header aria-label="Header content" role="banner">
            <button class="win-backbutton" aria-label="Back" disabled type="button"></button>
            <h1 class="titlearea win-type-ellipsis">
                <span class="pagetitle">displaying dates</span>
            </h1>
            <div class="codelink" data-codepage="./pages/bindings/dates/dates"><span class="symbol">&#xE160;</span><span class="text">show me the code !</span></div>
        </header>
        <section class="desc-screen" aria-label="Main content" role="main">
            <div class="bloc-description">
                <p>Displaying dates in applications is quite... usual</p>
                <p>
                    Managing date format in code works but it's not the right way to go. We prefer formating elements with bindings
                    and let code manage logic instead of managing display
                </p>
                <p>
                    Our date formating relies on <a data-page-link="./pages/bindings/arguments/arguments.html">parameterized bindings</a> and a javascript library called moment.js
                </p>
            </div>
            <div></div>
            <div class="bloc-content">
                <h2>date formats</h2>
                <div data-win-bind="innerText : curDate MCNEXT.Bindings.formatDate" data-win-bind-args='{ "formatDate" : "L"}'></div>
                <div data-win-bind="innerText : curDate MCNEXT.Bindings.formatDate" data-win-bind-args='{ "formatDate" : "DD-MM-YYYY HH:mm:ss"}'></div>
                <div>it is <span data-win-bind="innerText : curDate MCNEXT.Bindings.formatDate" data-win-bind-args='{ "formatDate" : "HH:mm:ss"}'></span></div>
                <div>we are on <span data-win-bind="innerText : curDate MCNEXT.Bindings.formatDate" data-win-bind-args='{ "formatDate" : "dddd"}'></span></div>

                <h2>days since date</h2>
                <div>it was <span data-win-bind="innerText : longAgo MCNEXT.Bindings.daysSinceDate" data-win-bind-args='{ "formatDate" : "L"}'></span> days ago</div>
            </div>
        </section>
    </div>
</body>
</html>
